package com.sky.blue.xmltool.jaxb;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class XmlTest {
    public static void main(String[] args) {

        Computer c1 = new Computer("1w1e","er23r1",new Date(),23.32);
        Computer c2 = new Computer("21w1e","2er23r1",new Date(),23.32);
        Computer c3 = new Computer("31w1e","3er23r1",new Date(),23.32);
        List<Computer>  computers = new ArrayList<>();
        computers.add(c1);
        computers.add(c2);
        computers.add(c3);


        Customer customer = new Customer(1, "Steven", "@sun123", new Date(), 1000.0,computers);
        String path = "D:/customer.xml";
        JaxbUtils.convertToXml(customer , path);
        System.out.println();


        Customer customer1 =(Customer)JaxbUtils.convertXmlFileToObject(Customer.class , path);
        System.out.println(customer1);


    }
}
